/*
package com.kabigon.tiny.service.impl;

import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.view.PoiBaseView;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.kabigon.tiny.entity.Student;
import com.kabigon.tiny.service.EasyPoiService;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.List;

*/
/**
 * EasyPoiService实现类
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny.service.impl
 * @data 2022/5/2 14:20
 *//*

@Service
@Slf4j
public class EasyPoiServiceImpl implements EasyPoiService {



    @Override
    public void exportExcel(ModelMap map, HttpServletRequest request, HttpServletResponse response) {
        ClassPathResource resource = new ClassPathResource("json/students.json");
        JSON json = JSONUtil.readJSON(resource.getFile(), StandardCharsets.UTF_8);
        List<Student> students = JSONArray.parseArray(json.toString(), Student.class);
        ExportParams params = new ExportParams("学生信息表", "学生信息", ExcelType.XSSF);
        map.put(NormalExcelConstants.DATA_LIST, students);
        map.put(NormalExcelConstants.CLASS, Student.class);
        map.put(NormalExcelConstants.FILE_NAME, "学生信息表");
        map.put(NormalExcelConstants.PARAMS, params);
        PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
    }

    @SneakyThrows
    @Override
    public String importExcel(MultipartFile file) {
        ImportParams params = new ImportParams();
        params.setTitleRows(1);
        params.setHeadRows(2);
        List<Student> list = ExcelImportUtil.importExcel(file.getInputStream(), Student.class, params);
        log.info("导入的数据：{}", JSONArray.toJSONString(list));
        return JSONUtil.toJsonPrettyStr(list);
    }
}
*/
